package com.lhb.aicodemother.service;

import com.lhb.aicodemother.model.dto.app.AppQueryRequest;
import com.lhb.aicodemother.model.entity.App;
import com.lhb.aicodemother.model.entity.User;
import com.lhb.aicodemother.model.vo.AppVo;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.service.IService;
import reactor.core.publisher.Flux;

import java.util.List;

/**
 * 应用 服务层。
 *
 * @author lihai
 */
public interface AppService extends IService<App> {


    /*
    * App转化为AppVo
    * */
    AppVo getAppVo(App app);

    /*
    * 获取QueryWrapper
    * */
    QueryWrapper getQueryWrapper(AppQueryRequest appQueryRequest);

    /*
    * AppList转化为AppVoList
    * */
    List<AppVo> getAppVoList(List<App> apps);


    /*
    * 聊天生成代码
    * */
    Flux<String> chatToGenCode(Long appId, String userMessage, User loginUser);

    /*
    * 部署app 返回部署路径
    * */
    String deployApp(Long appId,User loginUser);

    /*
    * 异步生成应用截图并更新封面
    * */
    void generateAppScreenshotAsync(Long appId,String appUrl);

}

